<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ice:panelGroup xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ice="http://www.icesoft.com/icefaces/component"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:htl="http://java.sun.com/jsf/composite/compo"
                rendered="#{questionnaireController.page == 'question'}">


    <h2><h:outputText value="Question" /></h2><!--#{bundle.QuestionTitle}-->
    
    <ice:panelGroup>
        <ice:panelGrid columns="3" >
            <ice:outputLabel value="Libelle :" for="libelle" /><!--#{bundle.QuestionLibelle}-->
            <ice:inputText id="libelle" value="#{questionController.question.libelle}" validatorMessage="*"/>
            <ice:message for="libelle"   errorClass="error"/>

            <ice:outputLabel value="Temps limite :" for="tmpsLimite" /><!--#{bundle.QuestionTempsLimite}-->
            <ice:inputText id="tmpsLimite" value="#{questionController.question.tempsLimiteQuestion}" size="3"/>
            <ice:message for="tmpsLimite" errorClass="error"/>

            <ice:outputLabel value="Type de rendu :" for="typeRendu" /><!--#{bundle.QuestionTypeRendu}-->
            <ice:selectOneMenu id="typeRendu" value="#{questionController.question.typeRendu}" partialSubmit="true">
                <f:selectItems value="#{questionController.listTypeRendu}"/>
            </ice:selectOneMenu>
            <br/>

            <ice:outputLabel value="Nombre de solution possible :" for="nbSolutionPossible" visible="#{questionController.question.typeRendu == 'CHECKBOX'}"/><!--#{bundle.QuestionNbSolutionPossible}-->
            <ice:inputText id="nbSolutionPossible" value="#{questionController.question.nbChoixPossible}" size="2" visible="#{questionController.question.typeRendu == 'CHECKBOX'}"/>
            <ice:message for="nbSolutionPossible" errorClass="error" visible="#{questionController.question.typeRendu == 'CHECKBOX'}"/>

            <ice:commandButton  action="#{questionController.enregistrerQuestion}" value="ENREGISTRER" rendered="#{!questionController.rendered}"/>
        </ice:panelGrid>
    </ice:panelGroup>



    <htl:question question="#{questionController.question}" typeQuestion="#{questionController.question.typeRendu}"
                  listTypeReponse="#{questionController.listTypeReponse}" rendered="#{questionController.rendered}"
                  ajouterReponse="#{questionController.ajouterReponse}" supprimerReponse="#{questionController.supprimerReponse}"
                  enregistrerQuestionReponse="#{questionController.enregistrerQuestionReponse}" typeReponse="#{questionController.typeReponse}"
                  target="#{questionController.reponse}" fileEntryResults="#{questionController.listFichierImage}"
                  sauvegarderImage="#{questionController.sauvegarderImage}"/>



</ice:panelGroup>

